<template>
  <div class="config-con">
    <BackTitle title="个人中心" :backgroundColor="{backgroundColor:'#f2f2f2'}"></BackTitle>
    <SpaCom>
      <template #name>
        <span @click="addressChange">地址管理</span>
      </template>
    </SpaCom>
    <SpaCom>
      <template #name>
        <span>经营证照</span>
      </template>
    </SpaCom>
    <SpaCom>
      <template #name>
        <span>协议规则</span>
      </template>
    </SpaCom>
    <SpaCom>
      <template #name>
        <span>协议规则</span>
      </template>
    </SpaCom>
    <SpaCom>
      <template #name>
        <span>小米商城用户协议</span>
      </template>
    </SpaCom>
    <div class="loginOut" @click="logout">
      退出账号
    </div>
  </div>
</template>

<script>
import { removeItem } from '@/Storage/index'
export default {
  name: 'ConFig',
  methods: {
    logout() {
      this.$dialog
        .confirm({
          message: '是否确认退出登入'
        })
        .then(() => {
          removeItem('token')
          this.$store.commit('CLEARUSERNAME')
          this.$router.push('/user')
        })
        .catch(() => {
          this.$toast('已取消')
        })
    },
    // 地址管理
    addressChange() {
      this.$store.commit('CHANGEORSELETED', true)
      this.$router.push('/address/addressList')
    }
  }
}
</script>

<style lang='less' scoped>
.config-con {
  font-size: 34px;
  .loginOut {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background-color: #f4f4f4;
    text-align: center;
    line-height: 100px;
    box-shadow: 0 3px 14px 2px rgba(0, 0, 0, 0.12);
  }
}
</style>
<style scoped>
/deep/ .box-com {
  padding: 0 20px 0 40px;
  font-size: 30px;
  height: 75px;
}
</style>
